package com.gqz.patrol.app.mapstruct;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gqz.common.core.domain.RequestForm;
import com.gqz.patrol.app.entity.EnPatrolTaskEntity;
import com.gqz.patrol.vo.EnPatrolTaskExcelVo;
import com.gqz.patrol.vo.EnPatrolTaskVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * @ClassName EnPatrolTaskMapstruct
 * @Description 能源-巡视工单表
 */
@Mapper(componentModel = "spring", imports = {})
@Component
public interface EnPatrolTaskMapstruct {

    EnPatrolTaskVo toVo(EnPatrolTaskEntity entity);

    List<EnPatrolTaskVo> toVos(List<EnPatrolTaskEntity> entity);

    Page<EnPatrolTaskVo> toVos(Page<EnPatrolTaskEntity> entity);

    Page<EnPatrolTaskExcelVo> toExcelVos(Page<EnPatrolTaskVo> taskVoPage);

    RequestForm<EnPatrolTaskVo> toVo(RequestForm<EnPatrolTaskExcelVo> requestForm);

    /**
     * 字段名称不要小写首字母紧接大写 e.g. aEndTime
     *
     * @param taskVo
     * @return
     */

    @Mapping(target = "pcTaskStatusNo", source = "PTaskStatusNo")
    @Mapping(target = "pcTaskStatusName", source = "PTaskStatusName")
    @Mapping(target = "appTaskStatusNo", source = "ATaskStatusNo")
    @Mapping(target = "appTaskStatusName", source = "ATaskStatusName")
    @Mapping(target = "appEndTime", source = "AEndTime")
    @Mapping(target = "appEndCoordinate", source = "AEndCoordinate")
    EnPatrolTaskExcelVo toExcelVo(EnPatrolTaskVo taskVo);

    @Mapping(source = "pcTaskStatusNo", target = "PTaskStatusNo")
    @Mapping(source = "pcTaskStatusName", target = "PTaskStatusName")
    @Mapping(source = "appTaskStatusNo", target = "ATaskStatusNo")
    @Mapping(source = "appTaskStatusName", target = "ATaskStatusName")
    @Mapping(source = "appEndTime", target = "AEndTime")
    @Mapping(source = "appEndCoordinate", target = "AEndCoordinate")
    EnPatrolTaskVo excelToVo(EnPatrolTaskExcelVo taskVo);

    EnPatrolTaskEntity toEntity(EnPatrolTaskVo vo);

    List<EnPatrolTaskEntity> toEntitys(List<EnPatrolTaskVo> vos);


}
